import request from "./request";

const getUserFriends = async (data) => {
    return await request({
        url: "/api/friendship/" + data.id + "/user/",
        method: "get",
    })
}

const getMemberGroups = async (data) => {
    return await request({
        url: "/api/group/" + data.id + "/members/",
        method: "get",
    })
}

const getFriends = async () => {
    return await request({
        url: "/api/friendship/",
        method: "get",
    })
}

const getGroups = async () => {
    return await request({
        url: "/api/group/",
        method: "get",
    })
}

const getFriendMessages = async (data) => {
    return await request({
        url: "/api/friendship/" + data.self_id + "/self_id/" + data.friendship_id + "/messages/",
        method: "get"
    })
}
export default {
    getFriends,
    getGroups,
    getUserFriends,
    getMemberGroups,
    getFriendMessages
}